<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>07-定位的扩展</title>
    <style>
        .father{
            width: 800px;
            height: 400px;
            border: 1px solid black;
            position: relative;
        }
        .son{
            width: 200px;
            height: 100px;
            background-color: red;
            position: absolute;
            left: 50%;
            margin-left: -100px;
            /* margin: auto; */
            top: 50%;            /* 父盒子*/
            margin-top: -50px;   /* 子盒子*/
            /* left: 37.5%; */
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="son"></div>
    </div>
    <!-- 
        作业：
        使用定位的概念完成红方块的居中--------太简单啦

     -->
</body>
</html>